/**
 * 
 */
package com.contact.action;

import java.util.List;

import com.contact.model.Message;
import com.contact.service.ContactService;
import com.opensymphony.xwork2.ActionSupport;

/**
 * @author David Zheng
 *
 */
public class MessageAction extends ActionSupport {
	
	private ContactService contactService;
	
	private List<Message> msgList;
	
	
	
	/* (non-Javadoc)
	 * @see com.opensymphony.xwork2.ActionSupport#execute()
	 */
	@Override
	public String execute() throws Exception {
		msgList = contactService.loadMessages();
		
		return ActionSupport.SUCCESS;
	}
	
	/**
	 * count the new msg
	 * @return
	 * @throws Exception
	 */
	public String msgPush() throws Exception {		
		//TODO: 
		return ActionSupport.SUCCESS;
	}

	/**
	 * @param contactService the contactService to set
	 */
	public void setContactService(ContactService contactService) {
		this.contactService = contactService;
	}

	/**
	 * @return the msgList
	 */
	public List<Message> getMsgList() {
		return msgList;
	}
	
	
	
	

}
